<?php
/*------------------------------------------------------------------------
 * LinkController.class.php 
 *
 * 链接管理
 * 	
 * Created on 2015-12-14
 *
 * Author: hwc123 <hwc123@139.com>
 * 
 * Copyright (c) 2015 http://www.qingtajiao.com All rights reserved.
 * ------------------------------------------------------------------------
 */

namespace Admin\Controller;
class LinkController extends CommonController{
	public $exec_comfunc  = 'index,add,edit,del,delete,recycle';//index,add,edit,delete
	
	public function index(){
		$type = $this->_get('type', '对不起，您的操作有误！');
		$where['type'] = $type;

		//省份
		$province_id = $this->_get('province_id');
		$info['province_id'] = $province_id;
		if($province_id && !$city_id){
			$where['province_id'] = $province_id;
		}
		//城市
		$city_id = $this->_get('city_id');
		$info['city_id'] = $city_id;
		if($city_id){
			$where['city_id'] = $city_id;
		}
		$this->assign('info', $info);
		//客服城市
		if($this->_city_id){
			$where['city_id'] = array(array('eq', $this->_city_id), array('eq', 0), 'or');
		}
		
		$where['is_delete'] = 0;
		parent::index('', $where);
	}
	public function recycle(){
		$where['type'] = $this->_get('type');
		parent::recycle('', $where);
	}
}